home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
percnt.zip
/
CTRLCOMM.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-11-10
|
3KB
|
83 lines
{***************************************************************************
NoMan Custom Control Library $Version$
Common Definitions Code Unit
$Author$ $Date$
Copyright 1991 Anthony M. Vitabile
Unit Description
This Turbo Pascal for Windows unit contains the code used to
initialize a DLL containing several new kinds of control windows
for use in dialog boxes. The code in this module defines common
declarations used by all the modules that comprise this library.
The library uses straight Windows calls and does NOT use Object-
Windows. This is to allow the control to be used by ANY Windows
program. In addition, the use of OWL in DLLs is not supported
at this time.
This code is adapted from the code that appeared in the July,
1990 issue of Microsoft Systems Journal article, "Extending the
Windows 3.0 Interface with Installable Custom Controls" by Kevin
P. Welch.
The DLL obeys the rules specified by Borland for compatibility
with its Resource Workshop resource editor.
***************************************************************************}
Unit CtrlCommonDefs;
Interface
Uses WinTypes;
const
Ctl_NoControls = 1; { Currently only have 1 control in the DLL }
{ Percent Control Constants }
PctNoStyles = 5; { Number of style bits we define }
Pct_Decades : longint = $01; { Place tick marks & % values every 10% }
Pct_Quarters: longint = $02; { Place tick marks & % values every 25% }
Pct_Halves : longint = $04; { Place tick marks & % values every 50% }
Pct_Axis : longint = $08; { Draw the tick marks on the control }
Pct_Digits : longint = $10; { Draw the percentage in the middle of the control }
Pct_ClassExtra = 0; { Number of extra bytes to allocate in the class }
Pct_ClassStyle = cs_HRedraw or cs_VRedraw or cs_GlobalClass;
Pct_Color = 0; { The background color of the control }
Pct_Name = 'PercentCtrl'; { Class name for the new control }
Pct_NoVariants = 1; { 5 different variants on this control }
Pct_Version = 100; { Version number is 1.00 }
Pct_WndExtra = 2; { Number of extra bytes to allocate in the window }
Pct_Percentage = 0; { GetWindowWord offset of the current percentage }
{ Define window messages }
pcm_ResetPercent = wm_User + 1; { Message to cause control to reset % to 0 }
pcm_AddPercent = wm_User + 2; { Message to cause control to add x % }
pcm_GetPercent = wm_User + 3; { Message to cause control to return its current setting }
pcm_SetPercent = wm_User + 4; { Message to cause control to set itself to x% }
{ Control Style Dialog box identifiers }
PctMask: longint = $FFFFFFF8;
type
StyleArray = array [0 .. CtlTypes - 1] of longint;
VarNameArr = array [0 .. CtlTypes - 1] of PChar;
var
Pct_WndStyle: StyleArray;
Pct_Variants: VarNameArr;
Implementation
const
CommonStyle: longint = ws_Child or ws_Visible;
begin
Pct_WndStyle[0] := CommonStyle;
Pct_Variants[0] := Pct_Name;
end.